package com.zjdiepu.www.ibiz.base;

import java.util.List;
import java.util.Set;

import com.qiniu.common.QiniuException;
import com.zjdiepu.www.base.core.AbstractSysUser;
import com.zjdiepu.www.base.enums.type.AttachmentLabel;
import com.zjdiepu.www.base.enums.type.AttachmentSort;
import com.zjdiepu.www.base.enums.type.ModeIDType;
import com.zjdiepu.www.base.enums.type.OperateType;
import com.zjdiepu.www.model.base.dto.OtherAttachments;
import com.zjdiepu.www.model.base.ext.OtherAttachmentsExt;
import com.zjdiepu.www.model.other.dto.OtherMediaFail;

/**
 * 附件信息Service层操作<br/>
 * @author xiongxiaotun<br/>
 * @time 2017年05月03日 11时48分<br/>
 * @since 1.0<br/>
 */
public interface IOtherAttachmentsService {
	/**
	 * 删除失效附件：征信模块
	 * @author xiongxiaotun <br/>
	 * @Title deleteInvalidAttachments  <br/>
	 * @param applyId 申请ID  <br/>
	 * @param sysUser 当前用户  <br/>
	 * @version V1.0  <br/>
	 */
	void deleteInvalidAttachments(String applyId, AbstractSysUser sysUser);
	/**
	 * 上传word，使用符合条件的图片填充内容
	 * @param sysUser
	 * @param wordFileName
	 * @param wordModeId
	 * @param wordAttachmentSort
	 * @param wordAttachmentLabel
	 * @param wordBusid
	 * @param applyId
	 * @param subDataId
	 * @param includeFileLabels
	 * @param excludeFileLabels
	 * @return
	 */
	String uploadWord(AbstractSysUser sysUser, String wordFileName, ModeIDType wordModeId, AttachmentSort wordAttachmentSort, AttachmentLabel wordAttachmentLabel, String wordBusid, /*word参数*/
			String applyId, String subApplyId, List<String> includeFileLabels, List<String> excludeFileLabels /*图片参数*/);
	
	/**
	 * 根据多媒体处理记录更新数据
	 * @param otherMediaFail 处理记录
	 */
	void saveProcessedMediaFile(OtherMediaFail otherMediaFail) throws QiniuException;
	
	/**
	 * 上传征信身份证正反面和征信授权照片
	 * @param zxcxApplyId
	 * @param sysUser
	 * @param attachmentSort 附件类型
	 * @param urls 图排路径
	 * 说明： 如果urls不为空，直接使用，否则通过zxcxApplyId查询到对应数据
	 */
	String saveWordToQiniu(String zxcxApplyId,String zxsubId, AttachmentSort attachmentSort, AbstractSysUser sysUser, String... urls);
	
	
	/**
	 * 更新
	 * @param otherAttachments 
	 */
	void update(OtherAttachments otherAttachments);
	
	/**
	 * 立刻更新
	 * @param otherAttachments 
	 */
	void updateJust(OtherAttachments otherAttachments);
	
	/**
	 * 添加
	 * @param otherAttachments 
	 */
	void insert(OtherAttachments otherAttachments);
	
	/**
	 * 立刻添加
	 * @param otherAttachments 
	 */
	void insertJust(OtherAttachments otherAttachments);
	
	/**
	 * 新增,更新和保存
	 * 
	 * @param OtherAttachments 
	 * @param OperateType 操作类型 {@link OperateType}
	 */
	void saveUpdateAndDelete(OtherAttachments otherAttachments,OperateType operType,String upDelete);
	
	/**
	 * 条件查询
	 * @date 2017年05月03日 11时48分
	 * @param otherAttachmentsExt
	 * @return
	 */
	List<OtherAttachments> selectByExt(OtherAttachmentsExt otherAttachmentsExt);
	
	/**
	 * 条件统计
	 * @date 2017年05月03日 11时48分
	 * @param otherAttachmentsExt
	 * @return
	 */
	int countByExt(OtherAttachmentsExt otherAttachmentsExt);
	
	/**
	 * 主键查询
	 * @date 2017年05月03日 11时48分
	 * @param id
	 * @return
	 */
	OtherAttachments selectById(String id);
	
	/**
	 * 根据主键清除空字段，设置值为null
	 * @date 2017年05月03日 11时48分
	 * @param fieldNames 字段名
	 * @param id 主键
	 */
	void clearEmpty(Set<String> fieldNames, String id);
	/**
	 * 精确统计(=)
	 * @author xiongxiaotun
	 * @time 2017年05月03日 11时48分
	 * @since 1.0
	 * @update
	 * @param sysPower
	 * @return
	 */
	int countRefined(OtherAttachments otherAttachments);
	/**
	 * 精确查询(=)
	 * @author xiongxiaotun
	 * @time 2017年05月03日 11时48分
	 * @since 1.0
	 * @update
	 * @param otherAttachments
	 * @return
	 */
	OtherAttachments selectRefined(OtherAttachments otherAttachments);
	/**
	 * @author xiongxiaotun <br/>
	 * @Title repeat  <br/>
	 * @Description 判断是否重复 <br/>
	 * @param otherAttachments
	 * @return
	 * @version V1.0  <br/>
	 */
	boolean repeat(OtherAttachments otherAttachments);
	
	/**
	 * @author xiongxiaotun <br/>
	 * @Title delectRefined  <br/>
	 * @Description 精确删除(=) <br/>
	 * @param otherAttachments
	 * @return
	 * @version V1.0  <br/>
	 */
	int deletedRefined(OtherAttachments otherAttachments);
	
	/**
	 * @author xiongxiaotun <br/>
	 * @Title: updateBatch  <br/>
	 * @Description:批量删除/禁用/启用  <br/>
	 * @param modifier 修改人
	 * @param modifierName 修改人名称
	 * @param dpStatus 修改后状态
	 * @param ids 待修改数据ID
	 * @return
	 * @version V1.0  <br/>
	 */
	int updateBatch(String modifier, String modifierName, Integer dpStatus, List<String> ids);
	
	/**
	 * @author xiongxiaotun <br/>
	 * @Title: insertBatch  <br/>
	 * @Description: 批量添加 <br/>
	 * @param otherAttachmentss
	 * @return
	 * @version V1.0  <br/>
	 */
	int insertBatch(List<OtherAttachments> otherAttachmentss);
	
}
